package com.shanghai.market.plshnaghai.home;

import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.shanghai.market.plshnaghai.MainActivity;
import com.shanghai.market.plshnaghai.R;
import com.shanghai.market.plshnaghai.TabsActivity;
import com.shanghai.market.plshnaghai.home.measurement.CompanyDivisionActivity;
import com.shanghai.market.plshnaghai.home.measurement.QuizzesActivity;
import com.shanghai.market.plshnaghai.may.EditSignatureActivity;
import com.shanghai.market.plshnaghai.publics.BaseFragment;

public class MayFragment extends BaseFragment implements View.OnClickListener {
    private TextView mBarTitle;
    private TextView mTextViewLable;
    private TabsActivity mActivity;
    private Context mContext;
    private TextView mImageViewLogin;


    private RelativeLayout mTextViewNews;   //消息提醒
    private RelativeLayout mTextViewCompanyDivsion;   //我要申请陪伴师
    private RelativeLayout mTextViewWallet;    //我的钱包
    private RelativeLayout mTextViewInvite;    //  邀请好友
    private RelativeLayout mTextViewMay;     //关于我们
    private RelativeLayout mTextViewUpdate;  //检查更新

    @Override
    public void onCreates() {

    }

    @Override
    public View initView(LayoutInflater inflater) {
        View view = inflater.inflate(R.layout.fragment_may, null);
        return view;
    }

    @Override
    public void initFindViewById(View view) {
        mBarTitle = (TextView) view.findViewById(R.id.text_title);
        mTextViewLable = (TextView) view.findViewById(R.id.textview_Label);
        mImageViewLogin = (TextView) view.findViewById(R.id.title_no_login);
        mTextViewCompanyDivsion = (RelativeLayout) view.findViewById(R.id.textView_CompanyDivision);
        mTextViewNews = (RelativeLayout) view.findViewById(R.id.textView_news);
        mTextViewWallet = (RelativeLayout) view.findViewById(R.id.textView_wallet);
        mTextViewInvite = (RelativeLayout) view.findViewById(R.id.textView_Invite);
        mTextViewMay = (RelativeLayout) view.findViewById(R.id.textView_may);
        mTextViewUpdate = (RelativeLayout) view.findViewById(R.id.textView_update);
        //    textView_news textView_CompanyDivision  textView_wallet   textView_Invite  textView_may  textView_update
    }

    @Override
    public void initData() {
        mContext = getActivity();
        mBarTitle.setText("我的");

    }

    @Override
    public void setListener() {
        mTextViewLable.setOnClickListener(this);
        mImageViewLogin.setOnClickListener(this);
        mTextViewCompanyDivsion.setOnClickListener(this);
        mTextViewNews.setOnClickListener(this);
        mTextViewWallet.setOnClickListener(this);
        mTextViewInvite.setOnClickListener(this);
        mTextViewMay.setOnClickListener(this);
        mTextViewUpdate.setOnClickListener(this);
    }

    @Override
    public void doBusiness() {

    }

    @Override
    public void onClick(View v) {
        Intent intent = null;
        switch (v.getId()) {
            case R.id.textview_Label:
                intent = new Intent(mContext, EditSignatureActivity.class);
                startActivity(intent);
            case R.id.title_no_login:
                intent = new Intent(mContext, MainActivity.class);
                startActivity(intent);
                break;
            case R.id.textView_CompanyDivision:
                intent = new Intent(mContext, QuizzesActivity.class);
                startActivity(intent);
                break;
            case R.id.textView_news:
                intent = new Intent(mContext, CompanyDivisionActivity.class);
                startActivity(intent);
                break;

            default:
                break;
        }

    }
}
